<?PHP
require_once("../settings.php");
require_once("../connect.php");
require_once("../functions.php");

# Run Personal Transactions XML and insert into database
	if ($settings['personaltransactions'] == true) {
$url = "http://api.eve-online.com/char/WalletTransactions.xml.aspx";
get_api($url);
	$xml = simplexml_load_file($xmlfile);
	unlink($xmlfile);
	if ($xml->error) {
		echo $xml->error[code].'<br />';
		log_error(array($info,$xml->error));
	}
	else {
		foreach ($xml->result->rowset->row as $row) {
		$query9 = "
INSERT IGNORE INTO `wallet` (`transactionDateTime`,`transactionID`,`quantity`,`typeName`,`typeID`,`price`,`clientID`,`clientName`,`stationID`,`stationName`,`transactionType`) VALUES ('".mysql_real_escape_string($row[transactionDateTime])."','".mysql_real_escape_string($row[transactionID])."','".mysql_real_escape_string($row[quantity])."','".mysql_real_escape_string($row[typeName])."','".mysql_real_escape_string($row[typeID])."','".mysql_real_escape_string($row[price])."','".mysql_real_escape_string($row[clientID])."','".mysql_real_escape_string($row[clientName])."','".mysql_real_escape_string($row[stationID])."','".mysql_real_escape_string($row[stationName])."','".mysql_real_escape_string($row[transactionType])."')";
		$result = $db->query($query9);
		}
	}
	} # End Personal Transactions XML

?>